package cn.itcast.bookmanager.jframe;

import org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class LanguageselectionFrame extends JFrame {
    private JFrame jf;
    public LanguageselectionFrame(){
        jf=new JFrame("图书管理");
        jf.getContentPane().setFont(new Font("幼圆", Font.BOLD, 14));
        jf.setBounds(600, 250, 500, 467);
        jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        jf.getContentPane().setLayout(null);

        JLabel label = new JLabel("语言选择");
        label.setFont(new Font("幼圆", Font.BOLD, 20));
        label.setBounds(200, 150, 130, 50);
        jf.getContentPane().add(label);

//        JButton buttonTitle = new JButton("");
//        buttonTitle.setBounds(173, 150, 130, 29);
//        jf.getContentPane().add(buttonTitle);

        JButton button = new JButton("中文");
        button.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                checkLogin(e);
            }
        });
        button.setBounds(153, 200, 65, 29);
        jf.getContentPane().add(button);

        JButton button_1 = new JButton("English");
        button_1.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                regUser(e);
            }
        });
        button_1.setBounds(263, 200, 65, 29);
        jf.getContentPane().add(button_1);

        JLabel lblNewLabel_1 = new JLabel("");
        lblNewLabel_1.setIcon(new ImageIcon(LoginFrame.class.getResource("/tupian/uBG.png")));
        lblNewLabel_1.setBounds(0, 0, 484, 429);
        jf.getContentPane().add(lblNewLabel_1);

        jf.setVisible(true);
        jf.setResizable(true);
    }

    protected void checkLogin(ActionEvent e) {
        jf.setVisible(false);
        new LoginFrame();
    }

    protected void regUser(ActionEvent e) {
        jf.setVisible(false);
        new LoginFrameen();
    }

    public static void main(String[] args) {
        try {
            BeautyEyeLNFHelper.frameBorderStyle = BeautyEyeLNFHelper.FrameBorderStyle.generalNoTranslucencyShadow;
            org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper.launchBeautyEyeLNF();
        } catch (Exception e) {
            e.printStackTrace();
        }
        new LanguageselectionFrame();
    }
}
